package com.jm;

import java.util.Random;

import com.jm.utils.Utils;
import com.jm.web.data.Mail;

public class Test {
	/**
	 * @param args
	 */
	public static void main(String[] args) {
//String ss = "DECLARE @nSpeed decimal(18,2),@nWeight decimal(18,2),@nEfficiency decimal(9,2)#10#10/*取“上機工藝單參數”*/#10select top 1 @nSpeed=b.nDiff03,@nWeight=b.nDiff05,@nEfficiency=90#10from dbo.pdWorkArtHdr a(nolock)#10   join dbo.pdWorkArtDtl b(nolock) on b.updWorkArtHdrGUID=a.uGUID#10   join dbo.mmMaterial ml(nolock) on ml.uGUID=a.ummMaterialGUID#10   left join dbo.tmColor cl(nolock) on cl.uGUID=a.utmColorGUID#10where a.iWorkArtType in (202,204) and b.iWorkArtItem=2#10   and b.sDiff01 like N'%梳棉%'#10   and a.sMaterialLot='B1207-0382'#10   /*and ml.sMaterialNo='2/32 53C40V7N' and cl.sColorNo='JS5203'*/#10#10/*取“任務可排量、機台可排量”*/#10declare @nTaskAllowQty decimal(18,2),@nEquiAllowQty decimal(18,2)#10declare @nMinQty decimal(18,2),@nWorkHours decimal(18,6)#10select @nTaskAllowQty=1.69#10select @nEquiAllowQty=544.32-0#10select @nEquiAllowQty=case when @nEquiAllowQty < 0 then 0 else @nEquiAllowQty end#10select @nMinQty=case when @nTaskAllowQty < @nEquiAllowQty then @nTaskAllowQty else @nEquiAllowQty end#10select @nWorkHours=#10   case when @nSpeed*@nWeight*@nEfficiency=0 then 0#10   else @nMinQty*5000/@nSpeed/60/@nWeight/(@nEfficiency*0.01) end#10select @nWorkHours=#10   case when @nWorkHours > 24 then 24 else @nWorkHours end#10#10#10select @nWeight as nDiff01#10  ,@nSpeed as nDiff02#10  ,@nEfficiency as nDiff03#10  ,@nWorkHours as iWorkHours#10  ,@nTaskAllowQty as nTaskAllowQty#10  ,@nEquiAllowQty as nEquiAllowQty";
//		
//		System.out.println(ss.replaceAll("#10", "\r\n"));
//		try {
////			for (int i = 0; i < 180; i++) {
//				Mail mail2 = new Mail();
////				mail2.setAuth(true);
////				if(i%2 == 0){
////					mail2.setFrom("enjoy@mail.jmknit.com");
////				}else{
////					mail2.setFrom("billy@mail.jmknit.com");
////				}
//				//mail2.setTo("weifengkashe@sina.com,billy@mail.jmknit.com,helen@mail.jmknit.com");
////				mail2.setFrom("yanjie@mailjmknit.com");
//				mail2.setTo("yanjie@mail.jmknit.com");
////				mail2.setCc("qing_hong@mail.jrknit.com");
//				mail2.setEncode(false);
//				
////				mail2.setSubject("[并发带1M附件]資訊郵件測試"+(i+1)+"! by yanjie");
//				mail2.setSubject("資訊郵件測試資訊郵件資訊郵件測試資訊郵件資訊郵件測試資訊郵件資訊郵件測試資訊郵件資訊郵件測試資訊郵件! by yanjie");
//				mail2.setContentType(Mail.TEXT);
//				mail2.setBody("資訊郵件測試 from webmail!");
//				Utils utils = new Utils(null);
//				utils.sendMail(mail2);
////				mail2.setFile(new File("c:\\123456.doc"));
////				mail2.setFileName("123456.doc");
////			    Thread t = new JMThread(mail2,i+1);
////		        t.start();
////			}
//			
//		} catch (Exception e) {
//			// TODO Auto-generated catch block
//			e.printStackTrace();
//		}
		Random rd = new Random();
		for (int i = 0; i < 10; i++) {
			System.out.println((char)(97+rd.nextInt(26)));
		}
		
	}
}
